﻿cmake_minimum_required(VERSION 3.16)
project(Nosepiece VERSION 0.1 LANGUAGES CXX)

set(CMAKE_AUTOUIC ON)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)

set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

add_subdirectory(NosepieceCommon)

find_package(QT NAMES Qt6 Qt5 REQUIRED COMPONENTS Core SerialPort)
find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS Core SerialPort)

add_library(NosepieceOUMIT SHARED
    NosepieceOUMIT/NosepieceOUMIT.h
    NosepieceOUMIT/NosepieceOUMIT.cpp
    NosepieceCommon/NosepieceInterface.h

)

add_library(NosepieceOlympusREMCB SHARED
    NosepieceOlympusREMCB/NosepieceOlympusREMCB.h
    NosepieceOlympusREMCB/NosepieceOlympusREMCB.cpp
    NosepieceCommon/NosepieceInterface.h
)

add_library(NosepieceOlympusCBFM SHARED
    NosepieceOlympusCBFM/NosepieceOlympusCBFM.h
    NosepieceOlympusCBFM/NosepieceOlympusCBFM.cpp
    NosepieceCommon/NosepieceInterface.h
)

add_library(NosepieceOlympusMX63 SHARED
    NosepieceOlympusMX63/NosepieceOlympusMX63.h
    NosepieceOlympusMX63/NosepieceOlympusMX63.cpp
    NosepieceCommon/NosepieceInterface.h
)

target_link_libraries(NosepieceOUMIT PRIVATE Qt${QT_VERSION_MAJOR}::SerialPort Qt${QT_VERSION_MAJOR}::Core NosepieceCommon)
target_compile_definitions(NosepieceOUMIT PRIVATE NOSEPIECE_LIBRARY)

target_link_libraries(NosepieceOlympusREMCB PRIVATE Qt${QT_VERSION_MAJOR}::SerialPort Qt${QT_VERSION_MAJOR}::Core NosepieceCommon)
target_compile_definitions(NosepieceOlympusREMCB PRIVATE NOSEPIECE_LIBRARY)

target_link_libraries(NosepieceOlympusCBFM PRIVATE Qt${QT_VERSION_MAJOR}::SerialPort Qt${QT_VERSION_MAJOR}::Core NosepieceCommon)
target_compile_definitions(NosepieceOlympusCBFM PRIVATE NOSEPIECE_LIBRARY)

target_link_libraries(NosepieceOlympusMX63 PRIVATE Qt${QT_VERSION_MAJOR}::SerialPort Qt${QT_VERSION_MAJOR}::Core NosepieceCommon)
target_compile_definitions(NosepieceOlympusMX63 PRIVATE NOSEPIECE_LIBRARY)
